[HVM] Initialise full regs structure for PIO requests.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 2 Aug 2006 08:52:03 +0000 (09:52 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Wed, 2 Aug 2006 08:52:03 +0000 (09:52 +0100)
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/hvm/io.c
xen/arch/x86/hvm/platform.c
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/vmx/vmx.c

index 4be6afdc01e4742f9c007ddde893e1722161c110..6549f8946d053d8f539eef131cc6b9a3f19de209 100644 (file)
@@ -695,12 +695,11 @@ void hvm_io_assist(struct vcpu *v)
 
             if ( p->type == IOREQ_TYPE_PIO )
                 hvm_pio_assist(regs, p, io_opp);
-            else {
+            else
                 hvm_mmio_assist(regs, p, io_opp);
-                hvm_load_cpu_guest_regs(v, regs);
-            }
 
             /* Copy register changes back into current guest state. */
+            hvm_load_cpu_guest_regs(v, regs);
             memcpy(guest_cpu_user_regs(), regs, HVM_CONTEXT_STACK_BYTES);
         }
         /* else an interrupt send event raced us */
index d2044fca437b5e05a6d14591977f8fa24475b3db..1b5c5966afcd1d72fc9a4bf16eb17a93880830aa 100644 (file)
@@ -827,7 +827,6 @@ void handle_mmio(unsigned long va, unsigned long gpa)
 
     /* Copy current guest state into io instruction state structure. */
     memcpy(regs, guest_cpu_user_regs(), HVM_CONTEXT_STACK_BYTES);
-
     hvm_store_cpu_guest_regs(v, regs, NULL);
 
     if ((inst_len = hvm_instruction_length(v)) <= 0) {
index 4490bd7f5f20a64b7d786ea58ae28c6a707212d1..01d48b2524d5fb93e796b4abf53d07953e3cb16f 100644 (file)
@@ -1416,6 +1416,7 @@ static void svm_io_instruction(struct vcpu *v)
 
     /* Copy current guest state into io instruction state structure. */
     memcpy(regs, guest_cpu_user_regs(), HVM_CONTEXT_STACK_BYTES);
+    hvm_store_cpu_guest_regs(v, regs, NULL);
 
     info.bytes = vmcb->exitinfo1;
 
index 66991e0a0e2349615ae98c042e397e644db56ac4..6dfea007aa220d535a2f89171dc1ed6e07313361 100644 (file)
@@ -1107,6 +1107,7 @@ static void vmx_io_instruction(unsigned long exit_qualification,
 
     /* Copy current guest state into io instruction state structure. */
     memcpy(regs, guest_cpu_user_regs(), HVM_CONTEXT_STACK_BYTES);
+    hvm_store_cpu_guest_regs(current, regs, NULL);
 
     __vmread(GUEST_RIP, &eip);
     __vmread(GUEST_CS_SELECTOR, &cs);